/**
 * @Description:
 * @author 紫霞
 * @since 2019/1/17
 */
// React基础组件
import React from 'react'
// dva 连接组件 - 连接route和model
import { connect } from 'dva'
// 引入antd的组件
import { Form, Col, Row, Button, Input, Select, DatePicker,Space, Cascader, Table, Checkbox, Tooltip, Tag, Upload, Icon, Modal, message } from 'antd'

import { Radio } from 'antd';
import moment from 'moment';
import FlagBtn from 'widget/FlagBtn/FlagView'
// import Ueditor from '../../../../widget/Editor/Ueditor.js'
import Ueditor from '../../../widget/Editor/Ueditor'
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
import PopUpSelect from 'widget/PopUpSelectnoModal/PopUpSelect'
const confirm = Modal.confirm;
const { TextArea } = Input;
const { RangePicker } = DatePicker;
const FormItem = Form.Item
const Option = Select.Option;
// 导入项目全局配置文件
import config from 'config/config'
import Uploader from 'widget/Upload'
// 引入model取值工具方法
import { mapStateToProps } from 'utils/view_utils'


//引入富文本编辑器
import styles from './activityRulesListStyle.less'
import classnames from 'classnames/bind'
let cx = classnames.bind(styles);

import activity_cover_01 from '../../../assets/img/infoAndActivity/activity_cover_01.png'

import Track from 'widget/Map/Track'
import { relative } from 'path';
import { type } from 'jquery';
import { push } from '../../../config/menu';


/**
 * description 路由视图及事件处理
 * dispatch 分发到models中的effects对应事件名
 * model 用于获取models中state定义的数据
 * form 表单对象
 */
const formItemLayout = {
  labelCol: { span: 8 },
  wrapperCol: { span: 15 },
};
const formItemLayout04 = {
  labelCol: { span: 16 },
  wrapperCol: { span: 6 },
}
const formItemLayout05 = {
  labelCol: { span: 4 },
  wrapperCol: { span: 20 },
}
const formItemLayout06 = {
  labelCol: { span: 4 },
  wrapperCol: { span: 4 },
}

const routeView = function ({ dispatch, model, form }) {

  const { resetFields, getFieldDecorator, validateFields, setFieldsValue } = form
  // 取出model对象，命名空间
  const { modelObj, namespace } = model

  // modelObj.xxx获取model中状态机的值
  let { detail, other, actionType, num, key, paramCode,addform, chooseFlag, ustdvisibe, idlist, chooseData, agentList,detailsPageNo, detailsPageSize, detailsTotal, imageUrls } = modelObj

  if (!!modelObj.biz) {
    pageProps.biz = modelObj.biz
    pageProps.biz.syncBackCbf = (biz) => {
      dispatch({
        type: `${namespace}/updateStore`,
        payload: { biz }
      })
    }
  }
  //用户管理表
  const chooseColumns = [
    {
      title: '姓名',
      dataIndex: 'name',
      key: 'name',
    },
    {
      title: '手机号码',
      dataIndex: 'mobile',
      key: 'mobile',
    },
    {
      title: '提供人',
      dataIndex: 'providerName',
      key: 'providerName',
    },
    {
      title: '备注',
      dataIndex: 'remake',
      key: 'remake',
    },
    {
      title: '更新时间',
      dataIndex: 'updateTime',
      key: 'updateTime',
    },
  ]
  // 更新State
  function updateState(params) {
    dispatch({
      type: `${namespace}/updateStore`,
      payload: params
    })
  }
  //图片删除时
  function removeImgUrl(type, key) {
    console.log(type, key);
    detail[type][key] = '';
    if(type==='sceBrokPosterImgs'){
      num = num + 1
      console.log(num,32323)
    }
    dispatch({
      type: `${namespace}/updateModel`,
      payload: { detail,num }
    });

  }
  //图片增加时
  function updateImageModel(value, type, key) {
    console.log(value, type, key,2222222222222);
    detail[type][key] = value;
    if(type==='sceBrokPosterImgs'){
      num = num - 1
    }
    dispatch({
      type: `${namespace}/updateModel`,
      payload: { detail,num }
    });
    console.log(detail.sceBrokTitleImgs)
  };


  //提交
  function submit(detail, paramCode) {
    let just = true
    if (detail.sceBrokTitleImgs == "" || 
      detail.sceBrokPosterImgs[0] == "" ||
      detail.sceBrokPosterImgs[1] == "" || 
      detail.sceBrokPosterImgs[2] == "" || 
      detail.activityRules == "" || 
      detail.shareWechatImgs[0] == "") {
      just = false
      return message.error('请将图片海报或规则信息补充完整');
    }
    if( (detail.noDevelopSecoBrok.loginSetTime&&Number(detail.noDevelopSecoBrok.loginSetTime)<0) ||
      Number(other)<0 || 
      !other){
      just = false
      return message.error('天数为必填项且不能小于0');
    }
    if (detail.termOfValiditySet.length){
      detail.termOfValiditySet.forEach(i => {
        if(Number(i.termOfValidity)<=0){
          just = false
          return message.error('发展二级经纪人有效期必须大于0');
        }
      })   
    }
    if(detail.renewalMethods.length){
      detail.renewalMethods.forEach(i => {
        if(i.renewalMethod&& Number(i.renewalNum)<0&&i.renewalNum){
          just = false
           message.error('续期次数不能小于0');
        }else if(i.renewalMethod&& Number(i.fixedDays)<=0&&i.fixedDays&&i.renewalDaysConf==2){
          just = false
          return message.error('固定天数必须大于0');
        }
      })
    }
    if(just){
      let quer = JSON.parse(JSON.stringify(detail))
      quer.renewalMethods.forEach(i =>{
        if(i.renewalDaysConf == 1){
          i.renewalDaysConf = 'TERM_OF_VALIDITY'
        }else{
          i.renewalDaysConf = 'FIXED_DAYS'
        }
      })
      let list = {
         idType: "other", 
         termOfValidity: Number(other) 
      }
      let jding = true
      quer.termOfValiditySet?quer.termOfValiditySet.forEach(i => {
        if(i.idType==="other"){
          jding = false
          i.termOfValidity = Number(other) 
        }
      }) : jding = false
      if(jding) {
        quer.termOfValiditySet.push(list)
      }
      let paramValue = JSON.stringify(quer);
      dispatch({
        type: `${namespace}/submit`,
        payload: { paramValue, paramCode }
      })
    }
    
  }


  //input改变时执行 获取内容
  function inputChange(e, title) {
    console.log(e);
    detail.activityRules = e;
    dispatch({
      type: `${namespace}/updateRadio`,
      payload: { detail }
    });
    console.log(detail);
  }


  //  准入规则   input输入框
  function isPublisvalue(e, type) {
    console.log(e, type);
    detail.noDevelopSecoBrok[type] = e ? Number(e) : null
    dispatch({
      type: `${namespace}/updateRadio`,
      payload: { detail }
    });
  }
  //  准入规则  多选框
  function inputonChange(e, type) {
    console.log(e, type);
    console.log(e == true ? 1 : 0);
    if (e == true) {
      e = 1;
    } else { e = 0 }
    detail.noDevelopSecoBrok[type] = e
    console.log(detail.noDevelopSecoBrok[type], "1");
    dispatch({
      type: `${namespace}/updateRadio`,
      payload: { detail }
    });
  }

  function andsubmit(e) {
    console.log(e);
    console.log(detail.renewalMethods)
    let quer = {
      idType: null, termOfValidity: null 
    }
    detail.termOfValiditySet.push(quer)
    dispatch({
      type: `${namespace}/updateModel`,
      payload: { detail }
    });
  }
  function deletjjr() {
    let idx = detail.termOfValiditySet.length ? detail.termOfValiditySet.length - 1 :0
    detail.termOfValiditySet.splice(idx,1)
    dispatch({
      type: `${namespace}/updateModel`,
      payload: { detail }
    });
    agentList.forEach(i => {
      i.disabled = false
      if(detail.termOfValiditySet.length) {
        detail.termOfValiditySet.forEach(e =>{
            if(i.id === e.idType){
                i.disabled = true
            }
        })
    }
  })
  dispatch({
    type: `${namespace}/updateRadio`,
    payload: { agentList}
  });
  }


  //有效期设置 下拉
  function onhandchange(e, index, selectedOptions) {
    detail.termOfValiditySet[index].idType = selectedOptions.props.value
    dispatch({
      type: `${namespace}/updateRadio`,
      payload: { detail}
    });
    agentList.forEach(i => {
        i.disabled = false
        if(detail.termOfValiditySet.length) {
          detail.termOfValiditySet.forEach(e =>{
              if(i.id === e.idType){
                  i.disabled = true
              }
          })
      }
    })
    dispatch({
      type: `${namespace}/updateRadio`,
      payload: { agentList}
    });
  }
  //有效期设置 输入框
  function handleChangess(e, index) {
    // console.log(detail.key);
    console.log(e.target.value,222,index);    //输入框的值
    if (e.target.value == '' || e.target.value <= 0) {
      message.error('请选择经纪人有效期天数');
    }
    detail.termOfValiditySet[index].termOfValidity = e.target.value ? Number(e.target.value) : null
    dispatch({
      type: `${namespace}/updateRadio`,
      payload: { detail }
    });
  }
  //其他身份发展二级经纪人有效期输入框
  function OtherChange(e) {
    console.log(e.target.value);
    other = e.target.value ? Number(e.target.value) : null
    dispatch({
      type: `${namespace}/updateRadio`,
      payload: { other }
    });
  }
  //有效期续期方式:  复选框
  function oninputonChange(e, type) {
    console.log(e, type);
    detail.renewalMethods[0].renewalMethod = e;
    
    dispatch({
      type: `${namespace}/updateRadio`,
      payload: { detail }
    });
  }
  //有效期续期方式:  复选框2
  function oninputonChanges(e, type) {
    detail.renewalMethods[1].renewalMethod = e;
      dispatch({
        type: `${namespace}/updateRadio`,
        payload: { detail }
      })
  }


  // 单选框 持续天数
  function onChangeRadio(e) {
    console.log(e)
      detail.renewalMethods[0].renewalDaysConf = e.target.value;
      dispatch({
        type: `${namespace}/updateModel`,
        payload: { detail }
      });
    
  }
  function onChangeRadios(e) {
    console.log('radio', e);
    detail.renewalMethods[1].renewalDaysConf = e.target.value;
    dispatch({
      type: `${namespace}/updateModel`,
      payload: { detail }
    });
  }
  //有效期续期方式  四个输入框
  function inpchang(e, type) {
    console.log(e.target.value, type);
    if (type == 'id1') {
      detail.renewalMethods[0].fixedDays = e.target.value ? Number(e.target.value) : null;
      dispatch({
        type: `${namespace}/updateRadio`,
        payload: { detail }
      });
    }
    if (type == 'id1a') {
      detail.renewalMethods[0].renewalNum = e.target.value ? Number(e.target.value) : null;
      dispatch({
        type: `${namespace}/updateRadio`,
        payload: { detail }
      });
    }
    if (type == 'id2') {
      detail.renewalMethods[1].fixedDays = e.target.value ? Number(e.target.value) : null;
      dispatch({
        type: `${namespace}/updateRadio`,
        payload: { detail }
      });
    }
    if (type == 'id2a') {
      detail.renewalMethods[1].renewalNum = e.target.value ? Number(e.target.value) : null;
      dispatch({
        type: `${namespace}/updateRadio`,
        payload: { detail }
      });
    }

  }

  // 图片计数
  function imgChange(detail) {
    console.log("img::", detail);
    let a = num
    if (detail.posterImgUrl1 != "") {
      a--
    }
    if (detail.posterImgUrl2 != "") {
      a--
    }
    if (detail.posterImgUrl3 != "") {
      a--
    }
    console.log(a);
    num = a
    dispatch({
      type: `${namespace}/updateModel`,
      payload: { num }
    });

  }
  // 打开弹窗
  function tube() {
    updateState({ chooseFlag: true })
    dispatch({
      type: `${namespace}/getuser`,
      payload:{}
    })
  }
  // 弹窗数据绑定
  function inputChanges(value, key) {
    if (key === 'createTime'){
      addform.beginUpdateTime = value[0];
      addform.endUpdateTime = value[1];
    }else{
      addform[key] = value;
    }
    dispatch({
      type: `${namespace}/updateStore`,
      payload: {addform},
    });
  }
  const rowSelection = {
    onChange: (selectedRowKeys, selectedRows) => {
      idlist = selectedRows.length ? selectedRows.map(i => {return i.id}) : []
      dispatch({
        type: `${namespace}/updateStore`,
        payload: {idlist},
      });
    },
  };
  //弹窗搜索条件/重置
  const onQuery = () => {
    dispatch({
      type: `${namespace}/getuser`,
      payload:{}
    })
  }
  const onReset = () => {
		dispatch({
			type: `${namespace}/onReset`,
			payload: {}
		});
		form.resetFields()
	}
  const choosePagination = {
		current: Number(detailsPageNo),
		pageNo: Number(detailsPageNo),
		pageSize: Number(detailsPageSize),
		total: Number(detailsTotal),
    showTotal: (e) => "共 " + detailsTotal + " 条",
		onChange: changePage, //分页事件
		onShowSizeChange: changePage, //每页条数
		showSizeChanger: true,
		showQuickJumper: true,
	}

	function changePage(page, pageSize) {
		dispatch({
			type: `${namespace}/getuser`,
			payload: {
				pageNo: page,
				pageSize: pageSize,
			}
		})
  }
  //导出
  function down() {
    dispatch({
        type: `${namespace}/down`,
        payload: {}
    });
  } 
  function exportData() {
    dispatch({
      type: `${namespace}/exportData`,
      payload: {}
    });
  }
  // 导入
  function updateImageModel1(value,fileObj) {
    console.log('updateImageModel',value,fileObj)
    imageUrls[0]={
        url:value,
        name:fileObj.name,
    };
    console.log(imageUrls)
    // 分发到model
    dispatch({
        type: `${namespace}/updateStore`,
        payload: { imageUrls }
    })
  };

  function removeImgUrl1(index) {
    imageUrls.splice(index, 1)
    dispatch({
        type: `${namespace}/updateStore`,
        payload: { imageUrls }
    })
  }
  return (
    <div className={cx('pageLayout')}>
      <div className='public_listMain'>
        <div className={"functionButton"}>
          <Button type='primary' onClick={e => submit(detail, paramCode)} >保存</Button>
        </div>
        {actionType != 'detail' &&
          <Form>
            <div className="boxShadow">
              <Row>
                <h3>准入规则:</h3>
                <Col span={24}>
                  不能被发展成为二级经纪人：
                  <Checkbox checked={detail.noDevelopSecoBrok.mideazyStaff} onChange={e => { inputonChange(e.target.checked, 'mideazyStaff') }} >美的置业员工</Checkbox>
                  <Checkbox checked={detail.noDevelopSecoBrok.frontLineSales} onChange={e => { inputonChange(e.target.checked, 'frontLineSales') }} >一线销售</Checkbox>
                  <Checkbox checked={detail.noDevelopSecoBrok.isLogin} onChange={e => { inputonChange(e.target.checked, 'isLogin') }} >
                    <Input disabled={detail.noDevelopSecoBrok.isLogin == 1 ? false : true} value={detail.noDevelopSecoBrok.loginSetTime}
                      onChange={e => { isPublisvalue(e.target.value, 'loginSetTime') }} type="number" style={{ width: '30%' }} />天内登录过用户</Checkbox>
                  <Checkbox checked={detail.noDevelopSecoBrok.designatedUser} onChange={e => { inputonChange(e.target.checked, 'designatedUser') }} >指定用户</Checkbox>
                  <FlagBtn node={<a onClick={tube} disabled={detail.noDevelopSecoBrok.designatedUser  ? false : true}>管理用户名单</a>}> </FlagBtn>
                </Col>
              </Row> <br />




              <Row>
                <h3>有效期设置:</h3>
                
                <div>
                  {
                    detail.termOfValiditySet.map((item, index) => {
                      return (
                        <Col span={18} style={{marginBottom: '10px'}} key={index}>
                          一级经纪人身份：
                          <Select
                              value={item.idType}
                              style={{ width: 180, marginRight: 80, marginLeft: 30 }}
                              onChange={(e,selectedOptions) => onhandchange(e,index,selectedOptions)}>
                              {
                                agentList.map((i, idx) => {
                                  return <Option value={i.id} key={idx} disabled={i.disabled || false}>{i.name}</Option>
                                })
                              }
                            </Select>
                          发展二级经纪人有效期:
                          <Input onChange={e => handleChangess(e,index)}
                              defaultValue={item.termOfValidity} type="number" style={{ width: '10%', marginLeft: 20 }} /> 天
                        </Col>
                      )
                    })
                  }
                  <Button type='primary' onClick={e => andsubmit(detail)}>添加</Button>
                  <Button  onClick={e => deletjjr()} style={{marginLeft: '20px'}}>删除 </Button>
                </div>
                
                <Col span={18}><br />
                 其他身份发展二级经纪人有效期：
                 <Input type="number" value={other} style={{ width: '10%', marginLeft: 20 }} onChange={OtherChange}/> 天
                </Col>
              </Row><br />

              <h3>有效期续期方式:</h3>
              <Row className={cx('boxwrop')}>
                <Col span={6}>
                  <Checkbox
                    checked={detail.renewalMethods[0].renewalMethod}
                    onChange={e => { oninputonChange(e.target.checked) }} >二级经纪人推介客户</Checkbox>
                </Col>
                <Col span={18}>
                  <Radio.Group name="radiogroup" disabled={detail.renewalMethods[0].renewalMethod ? false : true} onChange={onChangeRadio} value={detail.renewalMethods[0].renewalDaysConf}>
                    续期天数：<Radio value={1}>按有效期顺延</Radio>
                    <Radio value={2}>固定天数  <Input onChange={(e) => inpchang(e, 'id1')} disabled={detail.renewalMethods[0].renewalDaysConf ==2 ? false : true}
                      type="number" style={{ width: '20%' }} value={detail.renewalMethods[0].fixedDays} /> 天
                      可续期次数： <Input type="number" onChange={(e) => inpchang(e, 'id1a')} style={{ width: '20%' }} value={detail.renewalMethods[0].renewalNum} /> 次</Radio>
                  </Radio.Group>
                </Col>
              </Row>
              <Row className={cx('boxwrop')}>
                <Col span={6}>
                  <Checkbox
                    checked={detail.renewalMethods[1].renewalMethod}
                    onChange={e => { oninputonChanges(e.target.checked) }} >邀请二级经纪人续期</Checkbox>
                </Col>
                <Col span={18}>
                  <Radio.Group name="radiogroup" onChange={onChangeRadios} value={detail.renewalMethods[1].renewalDaysConf} disabled={!detail.renewalMethods[1].renewalMethod  ? true : false}>
                    续期天数：<Radio value={1} >按有效期顺延</Radio>
                    <Radio value={2}>固定天数  <Input type="number" onChange={(e) => inpchang(e, 'id2')} disabled={detail.renewalMethods[1].renewalDaysConf ==2 ? false : true}
                      style={{ width: '20%' }} value={detail.renewalMethods[1].fixedDays} /> 天
                      可续期次数： <Input type="number" onChange={(e) => inpchang(e, 'id2a')} style={{ width: '20%' }} value={detail.renewalMethods[1].renewalNum} /> 次</Radio>
                  </Radio.Group>
                </Col>
              </Row> <br /><br /><br />




              <Row style={{marginBottom: '10px'}}>
                <Col span={5}>
                  <h3>发展经纪人顶部图片</h3>
                  <span className={cx('text')}>(规格:800px*640px且小于200kb)</span>
                </Col>
                <Col span={5}>
                  <h3>分享海报</h3>
                  <span className={cx('text')}>(规格:750px*600px且小于200kb)</span>
                </Col>
                <Col span={12}>
                  <h3>发展经纪人海报: <span  >{num}</span>/3 <span className={cx('text')}></span> </h3>
                  <span className={cx('text')}>(规格: 1080*2340且小于500kb)</span>
                </Col>
                {/* <Col span={12}>
                  <span className={cx('text')}>图片分辨率需要为524*1138，且文件大小在500kb以下，支持.jpg格式</span>
                </Col> */}
              </Row>
              <Row>
                <Col className="col" span={5}>
                  <FormItem
                    {...formItemLayout05}
                    extra={'支持.jpg格式'}
                    required={true}>
                    <div className={cx('uploaderBox')}>
                      <div className={cx('uploaderDiv')}>
                        <Uploader
                          uploadedUrls={detail.sceBrokTitleImgs[0]}
                          removeFileCbf={() => { removeImgUrl('sceBrokTitleImgs', 0) }}
                          uploadSuccessCbf={detail.sceBrokTitleImgs[0] ? detail.sceBrokTitleImgs[0] : (imgUrl) => { updateImageModel(imgUrl, 'sceBrokTitleImgs', 0) }}
                          showType={'6'}
                          minCropBoxWidth={750}
                          minCropBoxHeight={600}
                          fileType='image'
                          fileMaxSize='0.2'
                          maxFiles='1' />
                      </div>
                    </div>
                  </FormItem>
                  
                </Col>
                <Col className="col" span={5}>
                  <FormItem
                    {...formItemLayout05}
                    extra={'支持jpg、png格式'}
                    required={true}>
                    <div className={cx('uploaderBox')}>
                      <div className={cx('uploaderDiv')}>
                        <Uploader
                          uploadedUrls={detail.shareWechatImgs[0]}
                          removeFileCbf={() => { removeImgUrl('shareWechatImgs', 0) }}
                          uploadSuccessCbf={detail.shareWechatImgs[0] ? detail.shareWechatImgs[0] : (imgUrl) => { updateImageModel(imgUrl, 'shareWechatImgs', 0) }}
                          showType={'6'}
                          minCropBoxWidth={800}
                          minCropBoxHeight={640}
                          fileType='image'
                          fileMaxSize='0.2'
                          maxFiles='1' />
                      </div>
                    </div>
                  </FormItem>
                </Col>
                <Col className="col" span={3}>
                  <FormItem
                    {...formItemLayout05}
                    extra={'只支持.jpg格式'}
                    required={true}>
                    <div className={cx('uploaderBox')}>
                      <div className={cx('uploaderDiv')}>
                        <Uploader
                          uploadedUrls={detail.sceBrokPosterImgs[0]}
                          removeFileCbf={() => { removeImgUrl('sceBrokPosterImgs', 0) }}
                          uploadSuccessCbf={detail.sceBrokPosterImgs[0] ? detail.sceBrokPosterImgs[0] : (imgUrl) => { updateImageModel(imgUrl, 'sceBrokPosterImgs', 0) }}
                          showType={'6'}
                          minCropBoxWidth={1080}
                          minCropBoxHeight={2340}
                          fileType='image'
                          fileMaxSize='0.5'
                          maxFiles='1' />
                      </div>
                    </div>
                  </FormItem>
                </Col>
                <Col className="col" span={3}>
                  <FormItem
                    {...formItemLayout05}
                    extra={'只支持.jpg格式'}
                    required={true}>
                    <div className={cx('uploaderBox')}>
                      <div className={cx('uploaderDiv')}>
                        <Uploader
                          uploadedUrls={detail.sceBrokPosterImgs[1]}
                          removeFileCbf={() => { removeImgUrl('sceBrokPosterImgs', 1) }}
                          uploadSuccessCbf={detail.posterImgUrl2 ? detail.posterImgUrl2 : (imgUrl) => { updateImageModel(imgUrl, 'sceBrokPosterImgs', 1) }}
                          showType={'6'}
                          minCropBoxWidth={1080}
                          minCropBoxHeight={2340}
                          fileType='image'
                          fileMaxSize='0.5'
                          maxFiles='1' />
                      </div>
                    </div>
                  </FormItem>
                </Col>
                <Col className="col" span={3}>
                  <FormItem
                    {...formItemLayout05}
                    extra={'只支持.jpg格式'}
                    required={true}>
                    <div className={cx('uploaderBox')}>
                      <div className={cx('uploaderDiv')}>
                        <Uploader
                          uploadedUrls={detail.sceBrokPosterImgs[2]}
                          removeFileCbf={() => { removeImgUrl('sceBrokPosterImgs', 2) }}
                          uploadSuccessCbf={detail.posterImgUrl3 ? detail.posterImgUrl3 : (imgUrl) => { updateImageModel(imgUrl, 'sceBrokPosterImgs', 2) }}
                          showType={'6'}
                          minCropBoxWidth={1080}
                          minCropBoxHeight={2340}
                          fileType='image'
                          fileMaxSize='0.5'
                          maxFiles='1' />
                      </div>
                    </div>
                  </FormItem>
                </Col>
              </Row>
              <br /><br />
              <Row>
                <h3>二级经纪人活动规则</h3>
                {/* <Col span={14}><TextArea rows={8} onChange={(e) => { inputChange(e, 'activityRules') }} value={detail.activityRules} /></Col> */}
                <Ueditor id="activityDetail"
                  style={{ width: '100%', height: 900 }}
                  html={detail.activityRules || ''}
                  isShowPhone={false}
                  height={500}
                  inputChange={(e) => { inputChange(e, 'activityRules') }}
                />
              </Row>

            </div>
          </Form>}
        <Modal
          title='不能被发展二级经纪人用户名单'
          width="60%"
          visible={chooseFlag}
          footer={[]}
          onCancel={() => { updateState({ chooseFlag: false, clickRowData: {} }) }}
          // okText="确认"
          // cancelText="取消"
        >
          <Row style={{ marginTop: '22px' }}>
            <Col span={5}>
              <FormItem {...formItemLayout}
                label='手机号码'>
                {getFieldDecorator('IllegalBrokerMobile', {
                })(<Input
                  placeholder='请输入'
                  onChange={(e) => { inputChanges(e.target.value, 'IllegalBrokerMobile') }}
                />)}
              </FormItem>
            </Col>
            <Col span={5}>
              <FormItem {...formItemLayout}
                label='提供人'>
                {getFieldDecorator('providerName', {
                })(<Input
                  placeholder='请输入'
                  onChange={(e) => { inputChanges(e.target.value, 'providerName') }}
                />)}
              </FormItem>
            </Col>
            <Col span={9}>
              <FormItem {...formItemLayout}
                label='更新时间'>
                  {getFieldDecorator('createTime', {
                  })(
                    <RangePicker format="YYYY-MM-DD HH:mm:ss" onChange={(e, val) => inputChanges(val, 'createTime')} />
                  )}
              </FormItem>
            </Col>
            <Col span={5} style={{ marginTop: '5px' ,textAlign: 'right'}}>
              <Button type="primary" onClick={() => onQuery()} style={{ marginRight: '10px' }}>查询</Button>
              <Button onClick={() => onReset()} >重置</Button>
            </Col>
          </Row>
          <Row style={{textAlign: 'right',marginBottom: '10px'}}> 
            <Button onClick={() => dispatch({type: `${namespace}/del`,payload: {}})} style={{ marginRight: '10px' }}>移除</Button>
            <Button onClick={() => down()} style={{ marginRight: '10px' }}>下载模板</Button>
            <Button type="primary"  onClick={() => { updateState({ ustdvisibe: true, imageUrls: [] }) }} style={{ marginRight: '10px' }}>导入</Button>
            <Button type="primary"  onClick={() => exportData()} >导出</Button>
          </Row>
          <Table dataSource={chooseData}
            rowSelection={{
              type: 'Checkbox',
              ...rowSelection,
            }}
            columns={chooseColumns}
            pagination={choosePagination} />
        </Modal>
        <Modal title={'导入用户'}
          visible={ustdvisibe}
          okText={'导入'}
          cancelText={'取消'}
          // confirmLoading={() => }
          onCancel={(e) => {
             updateState({ ustdvisibe: false }) 
              // updateUploadModal()
          }}
          onOk={(e) => {
              dispatch({
                  type: `${namespace}/importAccount`,
                  payload: {}
              });
          }}
          width={720}>
            <div className={styles.modalCss}>
                <Form>
                    <Row>
                        <Col span={24}>
                            <FormItem label={'文件'}>
                                <Uploader
                                    uploadedUrls={imageUrls}
                                    removeFileCbf={(index) => { removeImgUrl1(index) }}
                                    uploadSuccessCbf={(imgUrl,fileObj) => { updateImageModel1(imgUrl,fileObj) }}
                                    showType='5'
                                    accept={'.xlsx,.xls'}
                                    uploadTip='支持*.xlsx, *.xls格式文件。'
                                    fileType='file'
                                    maxFiles='50'
                                />
                            </FormItem>
                        </Col>
                    </Row>
                </Form>
            </div>
        </Modal>
      </div>


    </div>



  )
}

// 连接视图(view)和模型(model)
export default connect(mapStateToProps)(Form.create()(routeView))
